Saving minimum macroblock data for subsequent encoding of other macroblocks

ABSTRACT

A video encoder including a first buffer containing a plurality of data values defining a macroblock of pixels of a video frame. The video encoder also includes a second buffer and an entropy encoder coupled to the first and second buffers and configured to encode a macroblock based on another macroblock. The entropy encoder identifies a subset of the data values from the first buffer defining a given macroblock and copies the identified subset to the second buffer, the subset of data values being just those data values used by the entropy encoder when subsequently encoding another macroblock.

CROSS-REFERENCE TO RELATED APPLICATION

The present application is a continuation of and claims priority to U.S.patent application Ser. No. 13/533,075, filed on Jun. 26, 2012 and nowissued U.S. Pat. No. 10,063,871, which claims priority to IndiaProvisional Patent Application No. 3846/CHE/2011, filed on Sep. 11,2011, which are hereby incorporated by reference.

BACKGROUND

High definition (HD) video comprises numerous macroblocks per frame. For1080p video, there are 8160 16×16 pixel macroblocks. Thus 8160macroblocks must be decoded 30 times per second, thereby imposing asignificant performance burden on the encoder. Video encoders often areconstructed in a pipeline fashion to improve throughput, but additionalperformance improvements may be desirable.

SUMMARY

An illustrative embodiment is directed to a video encoder including afirst buffer containing a plurality of data values defining a macroblockof pixels of a video frame. The video encoder also includes a secondbuffer and an entropy encoder coupled to the first and second buffersand configured to encode a macroblock based on another macroblock. Theentropy encoder identifies a subset of the data values from the firstbuffer defining a given macroblock and copies the identified subset tothe second buffer, the subset of data values being just those datavalues used by the entropy encoder when subsequently encoding anothermacroblock.

Another embodiment is directed to a video apparatus including a videoencoder including a first buffer containing a plurality of data valuesdefining a macroblock of pixels of a video frame. The video encoder alsoincludes a second buffer and an entropy encoder coupled to the first andsecond buffers. The entropy encoder is configured to encode a macroblockbased on another macroblock. The entropy encoder identifies a subset ofthe data values from the first buffer defining a given macroblock andcopies the identified subset to the second buffer, the subset of datavalues being just those data values used by the entropy encoder whensubsequently encoding another macroblock. The video apparatus alsoincludes a direct memory access (DMA) engine coupled to the videoencoder to transfer the identified subset from the second buffer tomemory external to the video encoder.

Yet another embodiment is directed to a method usable in a videoencoder. The method includes reading uncompressed non-contiguousportions from a data set in a first storage, the data set describing afirst macroblock, and the portions being some but not all of the dataset. The method further includes writing the portions to contiguouslocations in a second storage to form compressed macroblock information.The method also includes writing the compressed macroblock informationfrom the second storage to a third storage and encoding a secondmacroblock based on the compressed macroblock information from the thirdstorage.

BRIEF DESCRIPTION OF THE DRAWINGS

For a detailed description of exemplary embodiments of the invention,reference will now be made to the accompanying drawings in which:

FIG. 1 shows a system including a video encoder in accordance withvarious embodiments;

FIG. 2 illustrates a process by which a macroblock data set iscompressed for subsequent use in encoding another macroblock; and

FIG. 3 shows a method in accordance with various embodiments.

NOTATION AND NOMENCLATURE

Certain terms are used throughout the following description and claimsto refer to particular system components. As one skilled in the art willappreciate, companies may refer to a component by different names. Thisdocument does not intend to distinguish between components that differin name but not function. In the following discussion and in the claims,the terms “including” and “comprising” are used in an open-endedfashion, and thus should be interpreted to mean “including, but notlimited to . . . .” Also, the term “couple” or “couples” is intended tomean either an indirect or direct connection. Thus, if a first devicecouples to a second device, that connection may be through a directconnection, or through an indirect connection via other devices andconnections.

The term “macroblock” is used herein to represent a group of pixels tobe rendered on a display. A macroblock may be a 16×16 group of pixels,but can be a different size and need not be square in other embodiments.A frame of video data is represented by multiple macroblocks.

DETAILED DESCRIPTION

The following discussion is directed to various embodiments of theinvention. Although one or more of these embodiments may be preferred,the embodiments disclosed should not be interpreted, or otherwise used,as limiting the scope of the disclosure, including the claims. Inaddition, one skilled in the art will understand that the followingdescription has broad application, and the discussion of any embodimentis meant only to be exemplary of that embodiment, and not intended tointimate that the scope of the disclosure, including the claims, islimited to that embodiment.

FIG. 1 shows a block diagram of a video encoder 100 in accordance withvarious embodiments. The encoder 100 includes a motion estimator (ME)102, a motion compensator (MC) 104, a calculation engine (CALC) 106, anintra-prediction engine 107, an entropy encoder 108, a boundary strengthestimator 110, and a loop filter 112.

The motion estimator 102 and the motion compensator 104 cooperate toprovide macroblock inter-frame predictions (i.e., temporal predictions).The motion estimator 102 searches a previous frame for a matchingmacroblock to each macroblock in a current frame and generates a motionvector for a given macroblock based on a closest match for themacroblock in a previously encoded frame. The ME 102 writes the motionvector at a common offset in buffer 120 agreed upon by the ME 102 and MC104. The motion compensator 104 applies the motion vector produced bythe motion estimator 102 to the previously encoded frame to generate anestimate of the given macroblock.

The intra-prediction engine 107 analyzes a given macroblock withreference to one or more adjacent macroblocks in the same frame. Forexample, when encoding a given macroblock, the intra-prediction engine107 may analyze a macroblock directly above (upper macroblock), amacroblock to the right of the upper macroblock (upper rightmacroblock), a macroblock to the left of the upper macroblock (upperleft macroblock), and a macroblock immediately to the left of the givenmacroblock (left macroblock) to provide spatial predictions. Theintra-prediction engine 107 generates a spatial activity metric which itstores in buffer 103. Based on the analysis, the intra-prediction engine107 selects one of a plurality of intra-prediction modes for applicationto the given macroblock.

In addition to the motion vector, the ME 102 generates another metricknown as the Sum of Absolute Differences (SAD). The SAD is the sum ofthe absolute differences between pixels in a current macroblock andcorresponding pixels in a reference macroblock. The host processor 90reads the spatial activity metric generated by the intra-predictionengine 107 via buffer 103 and the SAD generated by the ME 102 andperforms a mode decision. In the mode decision, the host processor 90determines whether the current macroblock is to be encoded using eitheran intra-block encoding technique or an inter-block encoding technique.After making this mode decision, the host processor 90 programs the CALCengine 106 and the entropy encoder 108 to encode each macroblock inaccordance with the mode decision made for the macroblock.

In accordance with at least some embodiments of the invention, the intramode is fixed at 16×16 (one of the four 16×16 modes per the H.264standard) so that the intra-prediction engine 107 does not have to spendcycles to decide the mode. Further, the intra-prediction engine 107preferably is programmed to provide a measure of spatial activity of thecurrent block which is used to compare against a SAD of the motioncompensated block.

If the mode decision made by the host processor 90 is to inter-blockencode a given macroblock, the CALC engine 106 reads interpolated ormotion compensated luminance and chrominance values from a buffer 105shared between the MC 104 and CALC engine 106. The CALC engine 106 isgiven a copy of the current macroblock (also referred as the “original”macroblock) by the host processor 90 using the DMA engine 80. The CALCengine 106 takes the difference between motion compensated pixels andcurrent pixels to produce residuals. The residuals will be transformed,quantized, and saved to a buffer 113 shared between the CALC engine 106and the entropy encoder 108. As quantization is a lossy process (i.e.,the precision of the transformed coefficients will be lost when inversequantization is applied), the CALC engine will produce a reconstructedset of pixels by performing inverse quantization and inversetransformation. The CALC engine 106 will then save the reconstructedpixels in a buffer 111 shared between the CALC engine 106 and the loopfiler 112. The reconstructed pixels will be filtered by the loop filter112 based on the boundary strengths provided by the boundary strengthestimator 110. The loop filter 112 saves the filtered data to a buffer109 which is accessible also by the DMA engine 80.

If the mode decision made by the host processor 90 is to intra-blockencode a given macroblock, the CALC engine 106 reads the intra mode andperforms intra prediction for the mode for which it has been programmed.The CALC engine 106 computes the difference between intra-predictedpixels and current pixels and produces the residuals. The residuals willbe transformed, quantized, and saved into buffer 113. As noted above,quantization is a lossy process and thus the CALC engine will produce areconstructed set of pixels by performing inverse quantization andinverse transformation. The CALC engine 106 will then save thereconstructed pixels into buffer 111. The reconstructed pixels will befiltered by the loop filter 112 based on the boundary strengths providedby the boundary strength estimator 110. The loop filter 112 saves thefiltered data to buffer 109 at the end for the DMA engine 80 to store inexternal memory.

The entropy encoder 108 receives the transformed quantized residuals,and applies a suitable coding technique. For example, the entropyencoder 108 may apply one of context adaptive binary arithmetic codingand context adaptive variable length coding to produce an entropyencoded macroblock.

The entropy encoder 108 and the boundary strength estimator 110 shareand communicate with each other by way of macroblock data buffer(MBDATBUF) 121. The entropy encoder stores a data set in the MBDATBUF121 that defines a corresponding macroblock. The boundary strengthestimator 110 reads the macroblock data set of each macroblock andassigns strength values to the edges of blocks within the macroblock.For example, the boundary strength estimator 110 may apply strengthvalues to the edges of 4×4 or 8×8 blocks of each macroblock. Thestrength values may be determined based on, for example, inter-blockluminance gradient, size of applied quantization step, and difference inapplied coding.

The loop filter 112 receives the strength values provided from theboundary strength estimator 110 and filters the block edges inaccordance with the boundary strength values. Each filtered macroblockmay be stored for use by the motion estimator 102 and the motioncompensator 104 in inter-prediction.

Referring still to FIG. 1, the video encoder 100 also includes a buffer120 that is shared by the motion estimator (ME) 102 and the motioncompensator (MC) 104. Because the buffer 120 is shared by ME 102 and MC104, the buffer is referred to as an MEMC buffer 120. The MEMC buffer120 is also shared by a DMA engine 80 and/or a host processor 90. Thehost processor 90 itself may write video data to the MEMC buffer 120 orprogram the DMA engine 80 to write video data from storage 84 to thebuffer. Thus, the MEMC buffer 120 is accessible by multiple otherhardware units (e.g., ME 102, MC 104, DMA engine 80, and host processor90).

The MEMC buffer 120 preferably is operated in a “four buffer mode.” Fourbuffer mode means the MEMC buffer 120 is accessed as four pages. Eachpage may comprise any desired size such as 8 Kbytes. Each page can beaccessed by a different master than the other pages. Thus, the ME 102can access one page of the MEMC buffer 120, while the MC 104 and DMAengine 80 access other pages of the buffer.

As explained above, the entropy encoder 108 generates a data set foreach macroblock and stores that data set in the MBDATBUF 121 for use bythe boundary strength estimator 110. The data set defines thecorresponding macroblock. Table I below lists the various values thatare included in an illustrated data set for a given macroblock. In theembodiment of Table I, a macroblock data set includes 304 bytes.

TABLE I Full Macroblock Data Set Offset Bits Parameter Description 0x0063:56 MB_TYPE_ID Id number specifying type of macroblock 55:40mb_qp_delta QP difference from the previous macroblock 39end_of_slice_flag Flag to indicate the last macroblock in the slice 38mb_field_decoding_flag Flag to indicate adaptive frame/field macroblock37:17 Reserved 16 transform_size_8 × 8_flag Flag to indicate whether 4 ×4 transform or 8 × 8 transform was used 15:8  MB_QP QP Y (quantizerparameter) for the macroblock 7:6 Reserved 5 cond_mb_skip_flag Flag toindicate a skip macroblock where there are no non-zero coefficients 4mb_skip_flag Flag to indicate if the macroblock will be skipped or not.3:1 Reserved 0 available Flag to indicate if the macroblock is availableas a neighbor to current macroblock. 0x08 63:38 Reserved 37:36CodedBlockPatternChroma Flag to indicate whether AC/DC coefficients werecoded for chroma blocks 35:32 CodedBlockPatternLuma Flag to indicatewhether AC/DC coefficients were coded for luma blocks. 31:27 Reserved26:0  CBP_27 Bit field to indicate both luma and chroma coefficients.0x10 63:56 intra_chroma_pred_mode Infra chroma prediction mode. 55:16Reserved 15:0  PREV_INTRA_MODE_FLAGS Previous intra mode flagscorresponding to current macroblock. 0x18 63:56 REM_INTRA_MODE[7] Bitfields at a 4 × 4 block level 55:48 REM_INTRA_MODE[6] to capture theremainder 47:40 REM_INTRA_MODE[5] intra prediction mode. 39:32REM_INTRA_MODE[4] 31:24 REM_INTRA_MODE[3] 23:16 REM_INTRA_MODE[2] 15:8 REM_INTRA_MODE[1] 7:0 REM_INTRA_MODE[0] 0x20 63:56 REM_INTRA_MODE[15]55:48 REM_INTRA_MODE[14] 47:40 REM_INTRA_MODE[13] 39:32REM_INTRA_MODE[12] 31:24 REM_INTRA_MODE[11] 23:16 REM_INTRA_MODE[10]15:8  REM_INTRA_MODE[9] 7:0 REM_INTRA_MODE[8] 0x28 63:32 Reserved 31:24SUB_MB_TYPE_ID[3] Inter mb types at 8 × 8 block 23:16 SUB_MB_TYPE_ID[2]level. 15:8  SUB_MB_TYPE_ID[1] 7:0 SUB_MB_TYPE_ID[0] 0x30 63:56REF_IDX[1][3] List 0 and List 1 reference 55:48 REF_IDX[1][2] index at 8× 8 level. 47:40 REF_IDX[1][1] 39:32 REF_IDX[1][0] 31:24 REF_IDX[0][3]23:16 REF_IDX[0][2] 15:8  REF_IDX[0][1] 7:0 REF_IDX[0][0] 0x38 63:32MV[1][0] Motion vectors of the 31:0  MV[0][0] macroblock at 4 × 4 block0x40 63:32 MV[1][1] level for both List 0 and List 31:0  MV[0][1] 1reference frame as 0x48 63:32 MV[1][2] indicated by REF_IDX 31:0 MV[0][2] 0x50 63:32 MV[1][3] 31:0  MV[0][3] 0x58 63:32 MV[1][4] 31:0 MV[0][4] 0x60 63:32 MV[1][5] 31:0  MV[0][5] 0x68 63:32 MV[1][6] 31:0 MV[0][6] 0x70 63:32 MV[1][7] 31:0  MV[0][7] 0x78 63:32 MV[1][8] 31:0 MV[0][8] 0x80 63:32 MV[1][9] 31:0  MV[0][9] 0x88 63:32 MV[1][10] 31:0 MV[0][10] 0x90 63:32 MV[1][11] 31:0  MV[0][11] 0x98 63:32 MV[1][12]31:0  MV[0][12] 0xA0 63:32 MV[1][13] 31:0  MV[0][13] 0xA8 63:32MV[1][14] 31:0  MV[0][14] 0xB0 63:32 MV[1][15] 31:0  MV[0][15] 0xB863:56 Reserved 55:48 TOTAL_COEF[14] Total non zero coefficients of 47:40TOTAL_COEF[11] Luma block at 4 × 4 level 39:32 TOTAL_COEF[10] 31:24TOTAL_COEF[15] 23:16 TOTAL_COEF[13] 15:8  TOTAL_COEF[7] 7:0TOTAL_COEF[5] 0xC0 63:56 Reserved 55:48 TOTAL_COEF[22] Total non zerocoefficients of 47:40 TOTAL_COEF[23] Cb block at 4 × 4 level. 39:32TOTAL_COEF[21] 31:24 Reserved 23:16 TOTAL_COEF[18] Total non zerocoefficients of 15:8  TOTAL_COEF[19] Cr block at 4 × 4 level 7:0TOTAL_COEF[17] 0xC8 63:0  Reserved 0xD0 63:24 Reserved 23:16 QP_CR QPfor Cr samples 15:8  QP_CB QP for Cb samples 7:0 QP_Y QP for Y samples0xD8 63:56 REF_PIC_ID[1][3] Reference picture ID for all 55:48REF_PIC_ID[0][3] the 4 × 4 blocks of a 47:40 REF_PIC_ID[1][2] macroblockfor both List 0 39:32 REF_PIC_ID[0][2] and List 1. 31:24REF_PIC_ID[1][1] 23:16 REF_PIC_ID[0][1] 15:8  REF_PIC_ID[1][0] 7:0REF_PIC_ID[0][0] 0xE0 63:56 REF_PIC_ID[1][7] 55:48 REF_PIC_ID[0][7]47:40 REF_PIC_ID[1][6] 39:32 REF_PIC_ID[0][6] 31:24 REF_PIC_ID[1][5]23:16 REF_PIC_ID[0][5] 15:8  REF_PIC_ID[1][4] 7:0 REF_PIC_ID[0][4] 0xE863:56 REF_PIC_ID[1][11] 55:48 REF_PIC_ID[0][11] 47:40 REF_PIC_ID[1][10]39:32 REF_PIC_ID[0][10] 31:24 REF_PIC_ID[1][9] 23:16 REF_PIC_ID[0][9]15:8  REF_PIC_ID[1][8] 7:0 REF_PIC_ID[0][8] 0xF0 63:56 REF_PIC_ID[1][15]55:48 REF_PIC_ID[0][15] 47:40 REF_PIC_ID[1][14] 39:32 REF_PIC_ID[0][14]31:24 REF_PIC_ID[1][13] 23:16 REF_PIC_ID[0][13] 15:8  REF_PIC_ID[1][12]7:0 REF_PIC_ID[0][12] 0xF8 63:32 MVD[1][5] The motion vector difference31:0  MVD[0][5] at 4 × 4 level of the 0x100 63:32 MVD[1][7] neighboringmacroblocks. 31:0  MVD[0][7] 0x108 63:32 MVD[1][13] 31:0  MVD[0][13]0x110 63:32 MVD[1][15] 31:0  MVD[0][15] 0x118 63:32 MVD[1][10] 31:0 MVD[0][10] 0x120 63:32 MVD[1][11] 31:0  MVD[0][11] 0x128 63:32MVD[1][14] 31:0  MVD[0][14]

Macroblock data sets are also used to encode other macroblocks. Forexample, the entropy encoder 108 may encode a given macroblock usinginformation about a macroblock directly above (upper macroblock), amacroblock to the right of the upper macroblock (upper rightmacroblock), a macroblock to the left of the upper macroblock (upperleft macroblock), and a macroblock immediately to the left of the givenmacroblock (left macroblock). However, not all of the parameters in amacroblock data set are needed for the purpose of encoding othermacroblocks.

Table II below shows one example of just the parameters from Table Ithat may be needed by the entropy encoder 108 to encode othermacroblocks. This information is referred to as compressed macroblockinformation. The number of bytes of data in compressed macroblockinformation in the example of Table II is 128 bytes.

TABLE II Compressed Macroblock Information Offset Bits ParameterDescription 0x00 63:56 MB_TYPE_ID Id number specifying type ofmacroblock 55:40 mb_qp_delta QP difference from the previous macroblock39 end_of slice_flag Flag to indicate the last macroblock in the slice38 mb_field_decoding_flag Flag to indicate adaptive frame/fieldmacroblock 37:17 Reserved 16 transform_size_8 × 8_flag Flag to indicatewhether 4 × 4 transform or 8 × 8 transform was used 15:8  MB_QP QP Y(quantizer parameter) for the macroblock 7:6 Reserved 5cond_mb_skip_flag Flag to indicate a skip macroblock where there are nonon-zero coefficients 4 mb_skip_flag Flag to indicate if the macroblockwill be skipped or not. 3:1 Reserved 0 available Flag to indicate if themacroblock is available as a neighbor to current macroblock. 0x08 63:38Reserved 37:36 CodedBlockPatternChroma Flag to indicate whether AC/DCcoefficients were coded for chroma blocks 35:32 CodedBlockPatternLumaFlag to indicate whether AC/DC coefficients were coded for luma blocks.31:27 Reserved 26:0  CBP_27 Bit field to indicate both luma and chromacoefficients. 0x10 63:56 intra_chroma_pred_mode Intra chroma predictionmode. 55:16 Reserved 15:0  PREV_INTRA_MODE_FLAGS Previous intra modeflags corresponding to current macroblock. 0x30 63:56 REF_IDX[1][3] List0 and List 1 reference 55:48 REF_IDX[1][2] index at 8 × 8 level. 47:40REF_IDX[1][1] 39:32 REF_IDX[1][0] 31:24 REF_IDX[0][3] 23:16REF_IDX[0][2] 15:8  REF_IDX[0][1] 7:0 REF_IDX[0][0] 0x88 63:32 MV[1][10]Motion vectors 31:0  MV[0][10] 0x90 63:32 MV[1][11] 31:0  MV[0][11] 0xA863:32 MV[1][14] 31:0  MV[0][14] 0xB0 63:32 MV[1][15] 31:0  MV[0][15]0xB8 63:56 Reserved 55:48 TOTAL_COEF[14] Total non zero coefficients of47:40 TOTAL_COEF[11] Luma block at 4 × 4 level 39:32 TOTAL_COEF[10]31:24 TOTAL_COEF[15] 23:16 TOTAL_COEF[13] 15:8  TOTAL_COEF[7] 7:0TOTAL_COEF[5] 0xC0 63:56 Reserved 55:48 TOTAL_COEF[22] Total non zerocoefficients of 47:40 TOTAL_COEF[23] Cb block at 4 × 4 level. 39:32TOTAL_COEF[21] 31:24 Reserved 23:16 TOTAL_COEF[18] Total non zerocoefficients of 15:8  TOTAL_COEF[19] Cr block at 4 × 4 level 7:0TOTAL_COEF[17] 0xE8 63:56 REF_PIC_ID[1][11] Reference picture ID 55:48REF_PIC_ID[0][11] 47:40 REF_PIC_ID[1][10] 39:32 REF_PIC_ID[0][10] 31:24REF_PIC_ID[1][9] 23:16 REF_PIC_ID[0][9] 15:8  REF_PIC_ID[1][8] 7:0REF_PIC_ID[0][8] 0xF0 63:56 REF_PIC_ID[1][15] 55:48 REF_PIC_ID[0][15]47:40 REF_PIC_ID[1][14] 39:32 REF_PIC_ID[0][14] 0x110 63:32 MVD[1][15]Motion vector differences 31:0  MVD[0][15] 0x118 63:32 MVD[1][10] 31:0 MVD[0][10] 0x120 63:32 MVD[1][11] 31:0  MVD[0][11] 0x128 63:32MVD[1][14] 31:0  MVD[0][14]

The video encoder of FIG. 1 also includes an auxiliary buffer (AUX BFR)125 accessible to the entropy encoder 108 and the DMA engine 80. Theentropy encoder 108 preferably copies just the parameters from the fullmacroblock data set to the AUX BFR 125 that are needed to encode othermacroblocks. Thus, the MBDATBUF 121 stores the full macroblock data set,while the AUX BFR 125 stores the compressed macroblock information. Theentropy encoder 108 copies the needed portions of the macroblock dataset from MBDATBUF 121 by reading those portions and then writing them toAUX BFR 125.

The DMA engine 80 has access to the compressed macroblock information inAUX BFR 125 and then preferably writes the compressed macroblockinformation to memory 91. Memory 91 preferably is data memory accessibleto the host processor 90. In some embodiments, memory 91 is internal tothe host processor 90, but may be external to the host processor inother embodiments. The DMA engine 80 writes the compressed macroblockinformation content from AUX BFR 125 to memory 91 for subsequent use bythe entropy encoder 108 in encoding other macroblocks.

FIG. 2 depicts the multi-step process by which the macroblock data setis compressed and saved to external memory 91. The full macroblock dataset is stored in memory 91. The portions 123 that are needed to encodeother macroblocks are illustrated in cross-hatching. As illustrated, thevarious portions 123 needed to encode other macroblocks are stored inMBDATBUF 121 in a non-contiguous fashion. The entropy encoder 108 copiesthose particular portions 123 to the AUX BFR 125 in contiguous storagelocations. The DMA engine 80 then copies the entire compressedmacroblock information from AUX BFR 125 to another set of contiguousstorage locations in memory 91. The DMA engine 80 may write thepreviously saved compressed macroblock information from memory 91 backto the AUX BFR 125 for use by the entropy encoder.

FIG. 3 illustrates a corresponding method 200. The various actions shownin FIG. 3 can be performed in the order shown or in a different orderand two or more of the actions may be performed in parallel, rather thansequentially.

At 202, the method comprises the entropy encoder 108 readinguncompressed, non-contiguous portions from a data set in a firststorage. The first storage may be the MDDATBUF 121. The data setpreferably describes a macroblock. Further, the portions that are readat 202 preferably are some, but not all, of the data set.

At 204, method 200 includes the entropy encoder 108 writing the portionsread at 202 to contiguous locations in a second storage to formcompressed macroblock information. The second storage may be the AUX BFR125.

At 206, the method comprises the DMA engine 80 writing the compressedmacroblock information from the second storage (e.g., the AUX BFR 125)to a third storage. The third storage may be memory 91.

Finally, at 208, the method preferably comprises the entropy encoderencoding another macroblock based on the compressed macroblockinformation from memory 91 that was associated a different macroblock.That is, the compressed macroblock information pertains to a firstmacroblock and is used to compress a second macroblock.

In some embodiments, the compressed macroblock information used toencode a given macroblock represents one or more macroblocks thatsurround the given macroblock being encoded. For example, thesurrounding macroblocks may be the left, upper, upper-left, and/orupper-right macroblocks.

By compressing the macroblock data set and saving the compressedmacroblock information in external memory, a more efficient macroblocktransfer process is possible.

The above discussion is meant to be illustrative of the principles andvarious embodiments of the present invention. Numerous variations andmodifications will become apparent to those skilled in the art once theabove disclosure is fully appreciated. It is intended that the followingclaims be interpreted to embrace all such variations and modifications.

What is claimed is:
 1. A video encoder comprising: a memory configuredto store a first set of data that corresponds to a first macroblock of avideo frame; an entropy encoder coupled to the memory; and a buffercoupled to the entropy encoder, wherein the entropy encoder isconfigured to: determine which data from a first set of data are notneeded for encoding a second macroblock, and to identify all data fromthe first set of data, other than the data not needed for encoding asecond macroblock, as a second set of data; retrieve the second set ofdata from the memory; cause the second set of data to be stored in thebuffer; and encode the second macroblock using the second set of data.2. The video encoder of claim 1, wherein the second macroblock isanother macroblock in the video frame.
 3. The video encoder of claim 1,wherein the first macroblock is one of: a left macroblock with respectto the second macroblock; an upper-left macroblock with respect to thesecond macroblock; an upper macroblock with respect to the secondmacroblock; or an upper-right macroblock with respect to the secondmacroblock.
 4. The video encoder of claim 1, wherein the first set ofdata is stored in contiguous storage locations in the memory, whereinthe data of the second set correspond to only a portion of the first setof data and includes data stored in a first portion of the contiguousstorage location and a second portion of the contiguous storagelocations, the first and second portions of the contiguous storagelocations being non-contiguous.
 5. The video encoder of claim 1, whereinthe entropy encoder is further configured to cause the second set ofdata to be stored in contiguous storage locations in the buffer.
 6. Thevideo encoder of claim 1, wherein the first and second macroblocks eachhave a size of 16×16 pixels.
 7. The video encoder of claim 1, whereinthe first data is a motion vector of the first macroblock and the secondproperty is a property other than a motion vector of the firstmacroblock.
 8. The video encoder of claim 7, wherein the second data isone of luma and chroma information of the first macroblock.
 9. The videoencoder of claim 1 further comprising a direct memory access enginecoupled between the memory and the entropy encoder and configured to:retrieve the second set of data from the memory in response to theentropy encoder; receive the second set of data from the buffer; andcause the second set of data to be stored in the memory.
 10. The videoencoder of claim 9, wherein the direct memory access engine isconfigured to cause the second set of data to be stored to a set ofcontiguous locations in the memory.
 11. The video encoder of claim 1,wherein the memory is configured to store the first set of data thatincludes the second set of data stored in a set of non-contiguous memorylocations and a copy of the second set of data stored in a set ofcontiguous memory locations.
 12. An electronic system comprising: amemory configured to store a first set of data that corresponds to afirst macroblock of a video frame, wherein the first set of data definesthe first macroblock; an encoder coupled to the memory by a memoryinterface, wherein the encoder includes: a buffer; and an entropyencoder coupled to the buffer and configured to: determine which datafrom the first set of data are not needed for encoding the secondmacroblock, and to identify all data from the first set of data, otherthan the data not needed for encoding the second macroblock, as thesecond set of data; receive, from the memory, a second set of data thatis a subset of the first set of data and includes at least a first dataand a second data with the first and second properties being differenttypes of data; cause the second set of data to be stored in the buffer;and encode a second macroblock using the second set of data.
 13. Theelectronic system of claim 12, wherein the second macroblock is anothermacroblock in the video frame.
 14. The electronic system of claim 12,wherein the first macroblock is one of: a left macroblock with respectto the second macroblock; an upper-left macroblock with respect to thesecond macroblock; an upper macroblock with respect to the secondmacroblock; or an upper-right macroblock with respect to the secondmacroblock.
 15. The electronic system of claim 12, wherein: the firstset of data is stored in contiguous storage locations in the firstmemory; the data of the second set correspond to only a portion of thefirst set of data and includes data stored in a first portion of thecontiguous storage locations and a second portion of the contiguousstorage locations; and the first and second portions of the contiguousstorage locations are non-contiguous with respect to each other.
 16. Theelectronic system of claim 15, wherein the memory interface is a directmemory access (DMA) interface and is configured to transfer the secondset of data from the buffer to the memory.
 17. The electronic system ofclaim 12, wherein the entropy encoder further is configured to determinewhich data from the first set of data are not needed for encoding thesecond macroblock, to identify all remaining data from the first set ofdata other than the data not needed for encoding the second macroblockas the second set of data, and to selectively retrieve the second set ofdata from the memory.
 18. The electronic system of claim 17, wherein theentropy encoder is further configured to cause the second set of data tobe stored in contiguous storage locations in the memory.
 19. Theelectronic system of claim 12, wherein the first data is a motion vectorof the first macroblock and the second data is a property other than amotion vector of the first macroblock.